// 使用 spread 语法复制数组或对象中的数据
// 1、复制数组数据
let arr01 = ["apple", "banana", "orange"];
let arr02 = ["dog", "pig", "fish"];

// 不带三个点
let arr03 = [arr01, arr02];
console.log(arr03); // [ [ 'apple', 'banana', 'orange' ], [ 'dog', 'pig', 'fish' ] ]

// 使用 spread 语法
let arr04 = [...arr01, ...arr02];
console.log(arr04) // [ 'apple', 'banana', 'orange', 'dog', 'pig', 'fish' ]

// 2、复制对象数据
let stu01 = {
    stuId:555,
    stuName:"harry"
};
let stu02 = {
    schoolName: "atguigu",
    schoolAge: 12
}
let stu03 = {
    subject: "Java"
}
let student = {...stu01, ...stu02, ...stu03};
console.log(student)